package com.example.lizh.mvp_example.presenter;

import com.example.lizh.mvp_example.model.LoginModel;
import com.example.lizh.mvp_example.model.impl.LoginModelImpl;
import com.example.lizh.mvp_example.view.LoginView;

/**
 * Created by lizh on 2017/8/17.
 */

public class LoginPresenter {

    private LoginModel mLoginModel;
    private LoginView mLoginView;

    public LoginPresenter(LoginView loginView) {
        mLoginView = loginView;
        mLoginModel = new LoginModelImpl();
    }

    public void login() {
        String name = mLoginView.getName();
        String password = mLoginView.getPassword();
        // 订阅
        mLoginView.subscribe();
        // 登录
        mLoginModel.login(name, password);
    }
}
